<!-- author:朱春阳 -->
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"
	href="../easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../easyui/themes/color.css">
<link rel="stylesheet" type="text/css" href="../easyui/demo/demo.css">
<script type="text/javascript" src="../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>

</head>
<body>


	<table id="dg" title="My Users" class="easyui-datagrid"
		style="width: 700px; height: 250px" toolbar="#toolbar"
		pagination="true" rownumbers="true" fitColumns="true">


	</table>
	<div id="toolbar">
		<a href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-add" plain="true" onclick="newStandby()">New
			Standby</a> <a href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-remove" plain="true" onclick="destroyStandby()">Remove
			Standby</a>
	</div>

	<div id="dlg" class="easyui-dialog" style="width: 400px" closed="true"
		buttons="#dlg-buttons">
		<div
			style="margin-bottom: 20px; font-size: 14px; border-bottom: 1px solid #ccc">Standby
			Information</div>
		<div style="margin-bottom: 10px">
			<input name="startLocation" class="easyui-textbox" required="true"
				label="startLocation:" style="width: 100%">
		</div>
		<div style="margin-bottom: 10px">
			<input name="endLocation" class="easyui-textbox" required="true"
				label="endLocation:" style="width: 100%">
		</div>
		<div style="margin-bottom: 10px">
			<input name="startTime" class="easyui-datetimebox" required="true" label="uri"
				style="width: 100%">
		</div>
		
		<div style="margin-bottom: 10px">
			<input name="endTime" class="easyui-datetimebox" required="true"
				label="endTime:" style="width: 100%">
		</div>
		<div style="margin-bottom: 10px">
			<input name="startDay" class="easyui-datebox" required="true"
				label="startDay:" style="width: 100%">
		</div>
		<div style="margin-bottom: 10px">
			<input name="num" class="easyui-textbox" required="true" label="uri"
				style="width: 100%">
		</div>
		
		<div style="margin-bottom: 10px">
			<input name="price" class="easyui-textbox" required="true"
				label="price:" style="width: 100%">
		</div>
		<div style="margin-bottom: 10px">
			<input name="type" class="easyui-textbox" required="true"
				label="type:" style="width: 100%">
		</div>
	</div>

	<div id="dlg-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton c6"
			iconCls="icon-ok" onclick="saveStandby()" style="width: 90px">Save</a>
		<a href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')"
			style="width: 90px">Cancel</a>
	</div>
	<script type="text/javascript" src="../js/adminjs/easyui.js">
		
	</script>
	<script type="text/javascript">
		$('#dg').datagrid({
			url : '../Admin/TicketController/pageSelect',
			idField : "startLocation",
			columns : [ [ {
				field : 'ck',
				title : '选择 ',
				checkbox : true,
				width : 100
			}, {
				field : 'id',
				title : 'id',
				width : 100
			}, {
				field : 'startLocation',
				title : 'startLocation',
				width : 100
			}, {
				field : 'endLocation',
				title : 'endLocation',
				width : 100
			}, {
				field : 'endTime',
				title : 'endTime',
				formatter : formatDatebox,
				width : 100
			}, {
				field : 'startTime',
				title : 'startTime',
				formatter : formatDatebox,
				width : 100
			}, {
				field : 'num',
				title : 'num',
				width : 100
			}, {
				field : 'startDay',
				title : 'startDay',
				formatter : formatDatebox,
				width : 100
			}, {
				field : 'price',
				title : 'price',
				width : 100
			}, {
				field : 'type',
				title : 'type',
				width : 100
			} ] ]
		});

		function getTime(unixtime) {
			var ts = arguments[0] || 0;
			var t, y, m, d, h, i, s;
			t = ts ? new Date(ts * 1000) : new Date();
			y = t.getFullYear();
			m = t.getMonth() + 1;
			d = t.getDate();
			h = t.getHours();
			i = t.getMinutes();
			s = t.getSeconds();
			// 可根据需要在这里定义时间格式    
			return y + '-' + (m < 10 ? '0' + m : m) + '-'
					+ (d < 10 ? '0' + d : d) + ' ' + (h < 10 ? '0' + h : h)
					+ ':' + (i < 10 ? '0' + i : i) + ':'
					+ (s < 10 ? '0' + s : s);
		}

		Date.prototype.format = function(format) {
			var o = {
				"M+" : this.getMonth() + 1, // month    
				"d+" : this.getDate(), // day    
				"h+" : this.getHours(), // hour    
				"m+" : this.getMinutes(), // minute    
				"s+" : this.getSeconds(), // second    
				"q+" : Math.floor((this.getMonth() + 3) / 3),
				"S" : this.getMilliseconds()
			// millisecond    
			}
			if (/(y+)/.test(format))
				format = format.replace(RegExp.$1, (this.getFullYear() + "")
						.substr(4 - RegExp.$1.length));
			for ( var k in o)
				if (new RegExp("(" + k + ")").test(format))
					format = format.replace(RegExp.$1,
							RegExp.$1.length == 1 ? o[k] : ("00" + o[k])
									.substr(("" + o[k]).length));
			return format;
		}
		function formatDatebox(value) {
			if (value == null || value == '') {
				return '';
			}
			var dt;
			if (value instanceof Date) {
				dt = value;
			} else {
				dt = new Date(value);
			}

			return dt.format("yyyy-MM-dd hh:mm:ss"); //扩展的Date的format方法(上述插件实现)    
		}
	</script>
</body>
</html>